<template>
	<view>
		<view class="item-input">
			<text>姓名:</text><input v-model="name" type="text" placeholder="请填写姓名">
		</view>
		<view class="item-input">
			<text>手机号:</text><input v-model="mobile" maxlength="11" type="number" placeholder="请填写手机号">
		</view>
		<view class="btn-save" @click="saveBtn">
			保存
		</view>
	</view>
</template>

<script>
	import http from '@/shopro/request/index'
	export default {
		data() {
			return {
				mobile:'',
				name:''
			};
		},
		methods:{
			saveBtn(){
				if(this.mobile&&this.name){
					http('user.addHomephone',{
						mobile:this.mobile,
						name:this.name
					}).then(res=>{
						console.log(res);
						if(res.code==1){
							uni.showToast({
								icon:'none',
								title:'申请已发送，等待对方同意'
							})
							let uu = uni
							setTimeout(()=>{
								uu.navigateBack()
								// uu.navigateTo({
								// 	url:'./homeItem'
								// })
							},1500)
						}
					})
				}
			}
		}
	}
</script>

<style lang="scss">
.item-input {
	display: flex;
	align-items: center;
	background-color: #fff;
	padding:20px 9px ;
	position: relative;
	font-size: 20px;
	input {
		font-size: 20px;
	}
	text {
		min-width: 18%;
	}
	
	&::after {
		content: '';
		position: absolute;
		width: 94%;
		bottom: 0;
		left: 50%;
		height: 1px;
		background-color: #e5e5e5;
		transform: translateX(-50%);
	}
	// border-bottom: 1px solid #e5e5e5;
}
.btn-save {
	width: 94%;
	margin: 24px auto 0;
	height: 45px;
		background-image: linear-gradient(90deg, 
			#ff8300 0%, 
			#ff3d00 100%), 
		linear-gradient(
			#ffffff, 
			#ffffff);
		background-blend-mode: normal, 
			normal;
		border-radius: 23px;
		line-height: 45px;
		text-align: center;
		color: #ffffff;
		font-size: 20px;
}
</style>
